package com.tdkj.model.bbs;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * EjfAttach entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ejf_attach", catalog = "west")
public class EjfAttach implements java.io.Serializable {

	// Fields

	private Integer attachId;
	private EjfTopic ejfTopic;
	private Integer replyId;
	private String userId;
	private String localname;
	private Short localId;
	private String filename;
	private Integer filesize;
	private Integer credits;
	private String title;
	private Integer downloads;
	private String state;
	private Timestamp createTime;
	private Timestamp updateTime;

	// Constructors

	/** default constructor */
	public EjfAttach() {
	}

	/** minimal constructor */
	public EjfAttach(EjfTopic ejfTopic, String userId, String localname, String filename, Timestamp updateTime) {
		this.ejfTopic = ejfTopic;
		this.userId = userId;
		this.localname = localname;
		this.filename = filename;
		this.updateTime = updateTime;
	}

	/** full constructor */
	public EjfAttach(EjfTopic ejfTopic, Integer replyId, String userId, String localname, Short localId, String filename, Integer filesize, Integer credits, String title, Integer downloads, String state, Timestamp createTime, Timestamp updateTime) {
		this.ejfTopic = ejfTopic;
		this.replyId = replyId;
		this.userId = userId;
		this.localname = localname;
		this.localId = localId;
		this.filename = filename;
		this.filesize = filesize;
		this.credits = credits;
		this.title = title;
		this.downloads = downloads;
		this.state = state;
		this.createTime = createTime;
		this.updateTime = updateTime;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "attachID", unique = true, nullable = false)
	public Integer getAttachId() {
		return this.attachId;
	}

	public void setAttachId(Integer attachId) {
		this.attachId = attachId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "topicID", nullable = false)
	public EjfTopic getEjfTopic() {
		return this.ejfTopic;
	}

	public void setEjfTopic(EjfTopic ejfTopic) {
		this.ejfTopic = ejfTopic;
	}

	@Column(name = "replyID")
	public Integer getReplyId() {
		return this.replyId;
	}

	public void setReplyId(Integer replyId) {
		this.replyId = replyId;
	}

	@Column(name = "userID", nullable = false, length = 15)
	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	@Column(name = "localname", nullable = false, length = 50)
	public String getLocalname() {
		return this.localname;
	}

	public void setLocalname(String localname) {
		this.localname = localname;
	}

	@Column(name = "localID")
	public Short getLocalId() {
		return this.localId;
	}

	public void setLocalId(Short localId) {
		this.localId = localId;
	}

	@Column(name = "filename", nullable = false, length = 50)
	public String getFilename() {
		return this.filename;
	}

	public void setFilename(String filename) {
		this.filename = filename;
	}

	@Column(name = "filesize")
	public Integer getFilesize() {
		return this.filesize;
	}

	public void setFilesize(Integer filesize) {
		this.filesize = filesize;
	}

	@Column(name = "credits")
	public Integer getCredits() {
		return this.credits;
	}

	public void setCredits(Integer credits) {
		this.credits = credits;
	}

	@Column(name = "title", length = 50)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "downloads")
	public Integer getDownloads() {
		return this.downloads;
	}

	public void setDownloads(Integer downloads) {
		this.downloads = downloads;
	}

	@Column(name = "state", length = 1)
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	@Column(name = "createTime", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "updateTime", nullable = false, length = 19)
	public Timestamp getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}

}